<?php
$TaskId =$_GET['id']??'';
$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");
$sql = "update Task set TaskStatus = 2 where TaskId='{$TaskId}'";
$result = $db->exec($sql);
if ($result){
    echo'成功<a href="list.php">返回</a>';
}else{
    echo "shibai";
}